//判断浏览器是否是微信浏览器
function is_weixin() {
  let ua = navigator.userAgent.toLowerCase();
  return ua.indexOf("micromessenger") != -1;
}

//微信浏览器中打开H5隐藏顶部导航方法
const hidePageNavInWechatBrowser = () => {
  //#ifdef H5

  if (is_weixin()) {
    let pageNav = document.getElementsByTagName("uni-page-head");
    if (pageNav && pageNav[0]) {
      const element = pageNav[0] as HTMLElement;
      if (element.style) {
        element.style.display = "none";
      }
    }
  }
  //#endif
};
export { hidePageNavInWechatBrowser };